package com.xhy.controller;

import com.xhy.service.VideoSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class SearchController {
    @Autowired
    private VideoSearchService videoSearchService;

    @GetMapping("/search/videos")
    public Map<String, Object> videos(@RequestParam("q") String q, @RequestParam("page") Integer page, @RequestParam("per_page") Integer rows){
        return videoSearchService.videos(q, page, rows);
    }
}
